const { Controller } = require('egg')

class TypeController extends Controller {
    async list() {
        const { ctx, app } = this;

        try {
            const result = await ctx.service.type.list()
            //console.log(result)
            ctx.body = {
                code: 200,
                msg: '请求成功',
                data: {
                    list: result
                }
            }
        } catch(err) {
            ctx.body = {
                code: 500,
                msg: '系统错误',
                data: null
            }
        }
    }
}

module.exports = TypeController